Mark-up languages such as XML have become popular for managing data that is stored in databases. Therefore, relational databases have evolved into hybrid systems that store both relational data and XML data. In fact, in more recent versions of International Business Machine's DB/2 Database, XML was introduced as a data type. Moreover, SQL/XML and XQuery are new query languages on the XML data type. Optimization of search queries for the XML data type stored in database often relies on using statistics. These statistics help bound searches and queries.
However, one problem with optimizing queries using the XML data type is determining which statistics to collect. Another problem with optimizing queries using the XML data type is how to collect statistics in a bounded memory space. Still another problem with optimizing queries with the XML data type is estimating the cardinality of paths within database.
Therefore a need exists to overcome the problems with the prior art as discussed above.